#include <algorithm>
#include <array>
#include <cstdio>
#include <iostream>
#include <limits>
#include <queue>
#include <string>

typedef long long ll;

ll n;
const ll max_n = 3e5+5,ll_min{std::numeric_limits<ll>::min()};
std::array<ll, max_n> ans;
std::string s;

void dfs(const ll index,const ll now,const ll m){
    if(index==s.size()-1){
        ans[m]=std::max(ans[m],now);
        return;
    }
    const ll next_index{index+1};
    if(s[next_index]=='+'){
        dfs(next_index,now+1,m);
    }else{
        dfs(next_index,now-1,m);
    }
    dfs(next_index,(now^1),m+1);
}

int main(){
    freopen("confess.in", "r", stdin);
    freopen("confess.out", "w", stdout);

    std::cin>>n;

    for(ll _{0};_<n;_++){
        std::cin>>s;
        s=' '+s;
        ans.fill(ll_min);
        if(s[1]=='+'){
            dfs(1,1,0);
            
        }else{
            dfs(1,-1,0);
        }
        dfs(1,0+(0^1),1);
        for(ll i{0};i<s.size();i++){
            // std::cout<<"i:"<<i<<' ';
            std::cout<<ans[i]<<' ';
        }
        std::cout<<'\n'<<std::flush;
    }
}